package com.fjxd.feign.clients;

import com.fjxd.feign.fallback.UserClientFallbackFactory;
import com.fjxd.feign.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author csw
 */
@FeignClient(value = "userService", fallbackFactory = UserClientFallbackFactory.class)
public interface UserClient {
    /**
     * 通过id查询用户
     *
     * @param id 用户id
     * @return 返回一个user对象
     */
    @GetMapping("/user/{id}")
    User getUserId(@PathVariable Integer id);

    @GetMapping("/user/{id}/{money}")
    User upMoney(@PathVariable Integer id, @PathVariable double money);
}
